package com.scs.application.modules.dept.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.scs.application.core.entity.FlowEntity;
import com.scs.application.modules.upgrade.db.annotation.EntityClassAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityFieldAnnotation;
import com.scs.application.modules.upgrade.db.enums.EntityFieldType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;
/**
 * <p>
 *
 * </p>
 *
 */
@Data
@Accessors(chain = true)
@EntityClassAnnotation(remark = "科室预算表")
@TableName("dept_budget")
public class Budget extends FlowEntity {


    // id ,在父类中处理

    @EntityFieldAnnotation(
            text = "业务单号",
            length = "20",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String busKey;

    @EntityFieldAnnotation(
            text = "业务日期",
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private Date busDate;

    @EntityFieldAnnotation(
            text = "填写人",
            length = "20",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String busUser;


    @EntityFieldAnnotation(
            text = "科室id",
            type = EntityFieldType.LONG,
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String deptId;

    @EntityFieldAnnotation(
            text = "科室名称",
            length = "200",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String deptName;



    @EntityFieldAnnotation(
            text = "年月",
            length = "",
            not_null = true,
            default_value = "",
            comment = "年月 yyyy-MM"
    )
    private String periodYearMonth;

    @EntityFieldAnnotation(
            text = "年度",
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private Integer periodYear;

    @EntityFieldAnnotation(
            text = "月度",
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private Integer periodMonth;


    @EntityFieldAnnotation(
            text = "起始日期",
            length = "",
            not_null = false,
            default_value = "",
            comment = "月开始日期"
    )
    @JSONField(format = "yyyy-MM-dd")
    private Date startDate;

    @EntityFieldAnnotation(
            text = "终止日期",
            length = "",
            not_null = false,
            default_value = "",
            comment = "月结束日期"
    )
    @JSONField(format = "yyyy-MM-dd")
    private Date endDate;

    @EntityFieldAnnotation(
            text = "限额",
            length = "",
            not_null = false,
            default_value = "",
            comment = "预算金额"
    )
    private Double amount;


    @EntityFieldAnnotation(
            text = "限量",
            length = "",
            not_null = false,
            default_value = "",
            comment = "预算单品数量"
    )
    private Double qty;

    @EntityFieldAnnotation(
            text = "当月消耗金额",
            length = "",
            not_null = false,
            default_value = "",
            comment = "当月消耗金额"
    )
    private Double amountUseMonth;


    @EntityFieldAnnotation(
            text = "当月消耗单品数量",
            length = "",
            not_null = false,
            default_value = "",
            comment = "当月消耗单品数量"
    )
    private Double qtyUseMonth;


    /*上年相关字段*/
    @EntityFieldAnnotation(
            text = "上年限额",
            length = "",
            not_null = false,
            default_value = "",
            comment = "上年限额"
    )
    private Double lastYearAmount;

    @EntityFieldAnnotation(
            text = "上年限量",
            length = "",
            not_null = false,
            default_value = "",
            comment = "上年限量"
    )
    private Double lastYearQty;


    /*本年上月相关字段*/

    @EntityFieldAnnotation(
            text = "本年上月限额",
            length = "",
            not_null = false,
            default_value= "",
            comment = "本年上月限额"
    )
    private Double lastMonthAmount;

    @EntityFieldAnnotation(
            text = "本年上月限量",
            length = "",
            not_null = false,
            default_value= "",
            comment = "本年上月限量"
    )
    private Double lastMonthQty;



    @EntityFieldAnnotation(
            text = "备注",
            length = "200",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String remark;

    @EntityFieldAnnotation(
            text = "是否是全院限制",
            length = "",
            not_null = false,
            default_value = "0",
            comment = "1:全院耗材限制"
    )
    private Boolean flagHospital;

}
